package com.kaili.basic.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.pojo.dto.*;
import com.kaili.basic.pojo.entity.MdmGroupTree;
import com.kaili.basic.pojo.entity.MdmOrgEntity;
import com.kaili.basic.pojo.entity.MdmPushGroupEntity;
import com.kaili.basic.pojo.vo.MdmPushGroupByNameVo;
import com.kaili.basic.pojo.vo.MdmPushGroupVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * @Desc: 推送组mapper
 * @author: TBS
 * @Time: 2019/8/1 18:50
 * @Copyright: © 2018 杭州凯立通信有限公司 版权所有
 * @Warning: 本内容仅限于公司内部传阅,禁止外泄或用于其它商业目的
 */
@Mapper
public interface PushGroupMapper extends BaseMapper<MdmPushGroupEntity> {
    /**
    * @Desc:  通过id查询推送组
    * @author: TBS
    * @Time: 2019/8/1 18:48
    * @param id
    * @return com.kaili.basic.pojo.entity.MdmPushGroupEntity
    */
    MdmPushGroupEntity queryPushGroupById(Integer id);

    /**
    * @Desc:  条件查询机构
    * @author: TBS
    * @Time: 2019/8/1 18:48
    * @param mdmOrgQueryDto
    * @return java.util.List<com.kaili.basic.pojo.entity.MdmOrgEntity>
    */
    List<MdmOrgEntity> queryOrgRanges(MdmOrgQueryDto mdmOrgQueryDto);

    /**
    * @Desc:  条件查询分组
    * @author: TBS
    * @Time: 2019/8/1 18:48
    * @param MdmGroupQueryDto
    * @return java.util.List<com.kaili.basic.pojo.entity.MdmGroupTree>
    */
    List<MdmGroupTree> queryGroupRanges(MdmGroupQueryDto MdmGroupQueryDto);

    /**
    * @Desc:  添加推送组
    * @author: TBS
    * @Time: 2019/8/1 18:49
    * @param mdmPushGroupEntity
    * @return
    */
    void addPushGroup(MdmPushGroupEntity mdmPushGroupEntity);

    /**
    * @Desc:  推送组查重
    * @author: TBS
    * @Time: 2019/8/1 18:49
    * @param mdmPushGroupEntity
    * @return java.lang.Integer
    */
    Integer querySupplierPushGroup(MdmPushGroupEntity mdmPushGroupEntity);

    /**
    * @Desc:  通过id查询此分组的所有父分组
    * @author: TBS
    * @Time: 2019/8/1 18:49
    * @param id
    * @return java.lang.String
    */
    String queryGroupFather(Long id);

    /**
     * @Desc:  条件分页查询推送组
     * @author: TBS
     * @Time: 2019/8/5 15:10
     * @param mdmPushGroupQueryDto
     * @return com.baomidou.mybatisplus.plugins.Page<com.kaili.basic.pojo.vo.MdmPushGroupVO>
     */
   List<MdmPushGroupVO> queryPushGroup(Page<MdmPushGroupVO> page, MdmPushGroupQueryDto mdmPushGroupQueryDto);

    /***
     * @Desc:  设置code自增
     * @author: TBS
     * @Time: 2019/8/2 15:01
     *
     * @return java.lang.String
     */
    String getCode();

    /***
    * @Desc:  修改推送组
    * @author: TBS
    * @Time: 2019/8/2 17:07
    * @param mdmPushGroupEntity
    * @return void
    */
    void update (MdmPushGroupEntity mdmPushGroupEntity);

    /***
    * @Desc:  删除推送组
    * @author: TBS
    * @Time: 2019/8/5 10:05
    * @param id
    * @return void
    */
    void delete (@Param("id") int id);

    /***
    * @Desc:  导入时通过ID查名字
    * @author: TBS
    * @Time: 2019/8/5 8:53
    * @param name
    * @return int
    */
    int getPushGroupIdByName(String name);

    /***
    * @Desc: 导出
    * @author: TBS
    * @Time: 2019/8/5 9:54
    * @param
    * @return
    */
    List<MdmPushGroupVO> queryPushGroup(MdmPushGroupQueryDto mdmPushGroupQueryDto);

    /**
    * @Desc: 通过ID查询详情
    * @author: TBS
    * @Time: 2019/8/5 18:53
    * @param id
    * @return com.kaili.basic.pojo.vo.MdmPushGroupVO
    */
    MdmPushGroupVO queryById(Map<String,Object> map);


    /**
    * @Desc:  根据推送组名称查询id和名称
    * @author: TBS
    * @Time: 2019/8/6 10:30
    * @param map
    * @return java.util.List<com.kaili.basic.pojo.vo.MdmPushGroupByNameVo>
    */
    List<MdmPushGroupByNameVo> queryByName(Map<String,Object> map);

}

